Field of the Invention
The present invention relates to a motion vector detection apparatus and a method of controlling the motion vector detection apparatus, and more specifically relates to a technique of detecting a motion vector of a moving object.
Description of the Related Art
Panning exists as a technique of capturing that expresses a sense of speed of a moving object. Panning is a technique of obtaining an image in which the moving object is still and a background is blurred, by performing exposure while moving a camera so as to match movement of the object. When the amount of movement of the camera during exposure is small, blurring of the background is small, and the panning effect also is small. Therefore, such that the camera moves sufficiently during exposure, a slower shutter speed is set as the movement speed (on an imaging plane) of the object decreases.
Effects of panning are obtained by comparing the blurred background to the moving object in a still state, so it is important that the moving object is captured in a still state. Therefore, it is necessary to move the camera with that movement matched to movement of the object on the imaging plane during exposure, but this is not easy. When the movement speed of the camera is faster or slower than the movement speed of the object, the object is blurred also.
Therefore, a panning assist function that assists panning by applying a shake correction technique has been proposed (see Japanese Patent Laid-Open No. 2006-317848). In Japanese Patent Laid-Open No. 2006-317848, an offset between movement of the moving object and movement of the camera is detected based on motion vectors between images, and a shift lens is driven so as to correct the offset.
In Japanese Patent Laid-Open No. 2006-317848, among motion vectors that can be detected from images captured during movement of the camera, an area where a motion vector is smaller than in its surroundings is detected as an object area, and the motion vector of the object area is detected as the offset between movement of the moving object and movement of the camera.
In a case where a plurality of motion vectors have been detected within a certain area, it is known to use an average motion vector or a high-frequency motion vector as a representative motion vector of that area. However, in a case where this sort of representative motion vector is used as the motion vector of the object area in the above-described panning assist function, the following sort of problems occur.
For example, a representative motion vector obtained by averaging a plurality of motion vectors that were detected within an object area often expresses the angular velocity of an object in approximately the center of the angle of view. However, the angular velocity of the object is not necessarily fixed within the angle of view. For example, when an object having uniform linear motion is observed from one point, a greater angular velocity is observed as the distance between the observation position and the object decreases. Accordingly, in an image obtained with the panning assist function based on the representative motion vector, which expresses the angular velocity of the object in the center of the angle of view, even if the object is in a still state in the vicinity of the center of the angle of view, blurring increases as the distance from the center of the angle of view increases (as image height increases). Therefore, for example in a case where a focus detection area has been set to a position away from the center of a screen, an intended image (an image in which the focus detection area is in a still state) cannot be obtained even when the panning assist function is enabled.